package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"

	"ssnotify/internal/notify/apis"
)

func init() {
	RouterCheckRole = append(RouterCheckRole, registerNotifyConfRouter)
}

// 需认证的路由代码
func registerNotifyConfRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.NotifyConfig{}

	r3 := v1.Group("/api/notification/config").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r3.GET("/find", api.FindNotifyConfigList)
		r3.POST("/add", api.AddNotifyConfig)
		r3.POST("/modify", api.EditNotifyConfig)
		r3.POST("/remove", api.DeleteNotifyConfig)
		r3.POST("/invoke", api.InvokeNotifyConfig)
	}
}
